(function($){
 $.fn.countDown = function(options) {
   var endHour = options || 24; //24:00 UTC is 5:00pm PST
   var el = this;

   var intervalID = setInterval(function() {

     var now = new Date(); // Get Current Time

     var end = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()); // get target hour today
     end.setUTCHours(endHour,00,0); //Make sure we are seting 24:00 UTC (5:00pm PST)

     if (now > end) end.setDate(end.getDate() + 1);  // ensure target end time is in the future

     var nowInMilliseconds = now.getTime(); // Convert Now to millseconds
     var endInMilliseconds = end.getTime(); // Convert end target time to millseconds
     var millsecondsTillEnd = (endInMilliseconds - nowInMilliseconds); // end minus now equals remaining time. Easy math in milli
     var hoursTillEnd = Math.floor(millsecondsTillEnd / 3600000); // Multiplying buy millseconds in an hour and rounding the number down gives us the hours remaining
     var minTillEnd = Math.floor(59 - now.getMinutes());
     var secondsTillEnd = (59 - now.getSeconds());
     secondsTillEnd = (secondsTillEnd < 10 ? '0' : '') + secondsTillEnd;

     $(el).html('<b>Free for:</b> ' + hoursTillEnd + 'h ' +  minTillEnd + 'm ' +  secondsTillEnd + 's');

   }, 1000);

 }
})(jQuery);